import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    children: [
      {
        path: '',
        name: 'Home',
        component: () => import('@/views/Home.vue'),
        meta: {},
      },
    ],
  },
  {
    path: '/test',
    component: () => import('@/layout/index.vue'),
    children: [
      {
        path: '',
        name: 'Test',
        component: () => import('@/views/Test.vue'),
        meta: {
          requiresAuth: true, //标记需要登录的路由
        },
      },
    ],
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue'),
  },
]
const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
